import shutil
import os
from log import logger


def copy_and_rename_file(source_file, destination_file):
    if os.path.exists('testReport.xlsx'):
        os.remove('testReport.xlsx')
    # 复制文件
    shutil.copy(source_file, destination_file)

    # 重命名文件
    shutil.move(destination_file, 'testReport.xlsx')
